<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../../js/vue/vue.js"></script>
    <script src="../../js/jquery/jquery.js"></script>
</head>
<body>
    <div id="add">
        <form id="editForm">
            品牌:<input name="brandName"><br/>
            编码:  <input name="brandEncoding"><br/>
            <input type="button"value="提交"@click="add()">
        </form>
    </div>
    <script>
        var vue =new Vue({
            el:"#add",
            data:{},
            methods:{
                add:function () {
                    $.post("http://localhost:8080/brands/add",$("#editForm").serialize(),function (data){
                        if(data.code==200){
                            window.location.href="http://localhost/view/brand/list.html"
                        }
                    })
                }
            }
        });
    </script>

</body>
</html>